home *** CD-ROM | disk | FTP | other *** search
- Forwarded message:
-
- > I have one other small problem (more an annoyance, really) in that
- > I use Input #1 at the start of the game to load in the
- > level data which takes the form of several arrays of dimensions
- > (40,40) or so, and it takes absolutely *ages*. Is there
- > any quicker way of loading variables from disk? I have tried
-
- I would do it this way:
-
- First install MakeLib extension and LDos extension.
- Both are on aminet.
- Then just
-
- _LEVELDATA=Ma Malloc(40*40*_ITEM_SIZE*_NUMBER_OF_LEVELS,$1)
- Lopen 1,_FILENAME$,0
- If LLoad(1,_LEVELDATA,Fsize(_FILENAME$)>-1
- 'The level data is now in mem. Takes 0 seconds :-)
- Else
- 'An error occurred
- Endif
- Lclose 1
-
- LDos and Makelib revolutionize disk access in Amos IMO.
- I've never used the shitty slow Line Input# or Input# commands after
- installing these two wonder extensions :-)
-
- As a bonus, the levels take _MUCH_ less disk space if saved just as
- unformatted blocks of data instead of Print#ing them to an ascii file.
-
-